import React, { Component } from 'react'
import { HashRouter as Router, Route, Switch } from "react-router-dom";
function Demo() {
  return <h1>Demo</h1>;
}
function Dashboard() {
  return <h1>Dashboard</h1>;
}
export default class RouterConfig extends Component {
  state = {
    is_login: false,
  };
  render() {
    return (
      <div>
        <Router>
        {this.state.is_login ? (
          <Switch>
            <Route exact path="/dashboard" component={Dashboard}></Route>
            <Route exact path="/login" component={Demo}></Route>
          </Switch>
        ) : (
          <Switch>
            <Route exact path="/login" component={Demo}></Route>
          </Switch>
        )}
      </Router>
      </div>
    )
  }
}
